/**
 * Created by Administrator on 2017/10/19.
 */
import React from 'react';
import ImgShare from 'assets/img/share.png';
import css from './index.less';


export default class Share extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      userData: {nick: '', avatar: '', role: 1, score: 12},
    };
  }

  share() {

    Tida.share({
      title: '天猫双11，夜探紫禁城',
      content: '天猫双11，夜探紫禁城！天猫双11，夜探紫禁城！',
      url: '//sxtest.ews.m.jaeapp.com/hd/titatest/index.html',
      image: '//img.alicdn.com/bao/uploaded/i2/TB1Ra9zRpXXXXaYaXXXXXXXXXXX_!!0-item_pic.jpg',
      // 'targets': [0, 1, 2, 3, 4, 5, 6, 7],
      // 'weixinAppId': '',
      // 'weixinMsgType': 'image',
      // 'isAliUrl': true
    }, function(data) {
      console.log('share', data);
    });
  }


  render() {
    const { opa } = this.props;
    return (
      <img src={ImgShare} className={css.img} onClick={() => {
        this.share();
      }} style={{opacity: `${opa}`}}/>

    );
  }
}
